package pl.edu.agh.mgr.hotel.entities;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
@Table(name = "hotel")
public class Hotel {

	@Id
	@GeneratedValue
	@NotNull
	private long id;

	@NotNull
	@Size(max = 100)
	private String name;

	@NotNull
	@ManyToOne
	private Country country;

	@NotNull
	@ManyToOne
	private Province province;

	@NotNull
	@ManyToOne
	private City city;

	@NotNull
	@ManyToOne
	private Street street;

	@NotNull
	@Size(max = 20)
	private String address;

	@NotNull
	@ManyToOne
	private HotelType hotelType;

	@NotNull
	@OneToMany(cascade = CascadeType.ALL)
	private Set<Room> rooms = new HashSet<Room>();

	@NotNull
	@ManyToMany(cascade = CascadeType.ALL)
	private Set<RoomType> roomTypes;

	@OneToMany(cascade = CascadeType.ALL)
	private Set<ServiceDescription> servicesDescriptions;

	@NotNull
	private int dataLevel;
	
	public Hotel() {
	}

	public Hotel(long id, String name, Country country, Province province,
			City city, Street street, String address, HotelType hotelType,
			Set<Room> rooms, Set<RoomType> roomTypes, Set<ServiceDescription> servicesDescriptions, int dataLevel) {
		super();
		this.id = id;
		this.name = name;
		this.country = country;
		this.province = province;
		this.city = city;
		this.street = street;
		this.address = address;
		this.hotelType = hotelType;
		this.rooms = rooms;
		this.roomTypes = roomTypes;
		this.servicesDescriptions = servicesDescriptions;
		this.dataLevel = dataLevel;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public Province getProvince() {
		return province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	public Street getStreet() {
		return street;
	}

	public void setStreet(Street street) {
		this.street = street;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public HotelType getHotelType() {
		return hotelType;
	}

	public void setHotelType(HotelType hotelType) {
		this.hotelType = hotelType;
	}

	public Set<Room> getRooms() {
		return rooms;
	}

	public void setRooms(Set<Room> rooms) {
		this.rooms = rooms;
	}

	public Set<RoomType> getRoomTypes() {
		return roomTypes;
	}

	public void setRoomTypes(Set<RoomType> roomTypes) {
		this.roomTypes = roomTypes;
	}

	public Set<ServiceDescription> getServicesDescriptions() {
		return servicesDescriptions;
	}

	public void setServicesDescriptions(Set<ServiceDescription> servicesDescriptions) {
		this.servicesDescriptions = servicesDescriptions;
	}
	
	public int getDataLevel() {
		return dataLevel;
	}

	public void setDataLevel(int dataLevel) {
		this.dataLevel = dataLevel;
	}

}
